package com.jwsoft.manager.core.gateway.controller;

import com.jwsoft.manager.core.integration.EduSchoolLockAuditIntegration;
import com.jwsoft.manager.common.vo.eduSchoolLockAudit.EduSchoolLockAuditVO;
import com.jwsoft.manager.common.vo.eduSchoolLockAudit.EduSchoolLockAuditKeyVO;
import com.jwsoft.manager.common.vo.eduSchoolLockAudit.EduSchoolLockAuditQueryVO;
import com.github.pagehelper.PageInfo;
import com.bifang.engine.assistant.core.domain.AppResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import com.bifang.engine.protect.core.annotation.Idempotent;
import org.springframework.validation.annotation.Validated;
import com.bifang.assistant.common.constants.Validators;

/**
 * 学校地址锁定确认表网关
 *
 * @author zhang
 * @since 2025-01-08
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "学校地址锁定确认表", description = "学校地址锁定确认表")
public class EduSchoolLockAuditController {

    @Autowired
    public EduSchoolLockAuditIntegration eduSchoolLockAuditIntegration;

    @Operation(summary = "学校地址锁定确认表分页查询",description = "学校地址锁定确认表分页查询")
    @PostMapping(value = "/eduSchoolLockAudit0001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduSchoolLockAuditVO>> getList(@RequestBody @Validated EduSchoolLockAuditQueryVO vo) {
        return AppResponse.successData(eduSchoolLockAuditIntegration.getList(vo));
    }

    @Operation(summary = "学校地址锁定确认表根据主键查询详情",description = "学校地址锁定确认表根据主键查询详情")
    @PostMapping(value = "/eduSchoolLockAudit0002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSchoolLockAuditVO> getById(@RequestBody @Validated EduSchoolLockAuditKeyVO vo) {
        return AppResponse.successData(eduSchoolLockAuditIntegration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "学校地址锁定确认表新增",description = "学校地址锁定确认表新增")
    @PostMapping(value = "/eduSchoolLockAudit0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSchoolLockAuditVO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduSchoolLockAuditVO vo) {
        return AppResponse.successData(eduSchoolLockAuditIntegration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "学校地址锁定确认表修改",description = "学校地址锁定确认表修改")
    @PostMapping(value = "/eduSchoolLockAudit0005", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSchoolLockAuditVO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EduSchoolLockAuditVO vo) {
        return AppResponse.successData(eduSchoolLockAuditIntegration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "学校地址锁定确认表删除",description = "学校地址锁定确认表删除")
    @PostMapping(value = "/eduSchoolLockAudit0006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduSchoolLockAuditKeyVO vo) {
        eduSchoolLockAuditIntegration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "获取推送给学校的数据",description = "获取推送给学校的数据")
    @PostMapping(value = "/eduSchoolLockAudit0007", produces = "application/json;charset=UTF-8")
    public AppResponse pushSchoolLockAudit(@RequestBody @Validated EduSchoolLockAuditVO vo) {
        eduSchoolLockAuditIntegration.pushSchoolLockAudit(vo);
        return AppResponse.successMsg("推送成功！");
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "单个学校地址锁定确认",description = "单个学校地址锁定确认")
    @PostMapping(value = "/eduSchoolLockAudit0008", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSchoolLockAuditVO> auditSchoolLockAudit(@RequestBody @Validated(value = {Validators.Edit.class}) EduSchoolLockAuditVO vo) {
        return AppResponse.successData(eduSchoolLockAuditIntegration.auditSchoolLockAudit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "批量学校地址锁定确认",description = "批量学校地址锁定确认")
    @PostMapping(value = "/eduSchoolLockAudit0009", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSchoolLockAuditVO> batchAuditSchoolLockAudit(@RequestBody @Validated(value = {Validators.Edit.class}) EduSchoolLockAuditVO vo) {
        return AppResponse.successData(eduSchoolLockAuditIntegration.batchAuditSchoolLockAudit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "单个学校地址锁定",description = "单个学校地址锁定")
    @PostMapping(value = "/eduSchoolLockAudit0010", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSchoolLockAuditVO> auditSchoolLock(@RequestBody @Validated(value = {Validators.Edit.class}) EduSchoolLockAuditVO vo) {
        return AppResponse.successData(eduSchoolLockAuditIntegration.auditSchoolLock(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "批量学校地址锁定",description = "批量学校地址锁定")
    @PostMapping(value = "/eduSchoolLockAudit0011", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSchoolLockAuditVO> batchAuditSchoolLock(@RequestBody @Validated(value = {Validators.Edit.class}) EduSchoolLockAuditVO vo) {
        return AppResponse.successData(eduSchoolLockAuditIntegration.batchAuditSchoolLock(vo));
    }
}
